//// BackupWorker.cpp
//#include "backupworker.h"
//#include "clientBackup.hpp"
//#include <QSqlDatabase>
//#include <QSqlQuery>
//#include <QSqlError>

//extern DatabaseManager dbManager;
//BackupWorker::BackupWorker(QObject *parent,const std::string& dirPath, int userId)
//    : QObject(parent)
//    , currentDirPath(dirPath)
//    , _usrID(userId)
//{

//}
//void BackupWorker::run()
//{
//    qDebug() << "Available drivers:" << QSqlDatabase::drivers();
//    QSqlDatabase cloneDB = QSqlDatabase::addDatabase("QMYSQL","connection2");
//    cloneDB.setHostName(HOST); // 数据库服务器地址
//    cloneDB.setPort(PORT);
//    cloneDB.setDatabaseName(DATABASE); // 数据库名
//    cloneDB.setUserName(USER); // 数据库用户名
//    cloneDB.setPassword(PASSWD); // 数据库密码

//    if (!cloneDB.open())
//    {
//        qDebug() << "Failed to open database in worker thread:" << cloneDB.lastError().text();
//        return;
//    }
//    qDebug() << cloneDB;
//    cloudBackup::ClientBackup clientBackup(cloneDB, currentDirPath, _usrID);
//    clientBackup.RunClientBackupModule();
//    emit finished();  // 当任务完成时发出信号
//}
